package etnorservice.etnor_service.controller;
import etnorservice.etnor_service.service.CommitStatus;
import etnorservice.etnor_service.service.RepositoryService;
import org.apache.juli.logging.Log;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class RepositoryController {

    private final RepositoryService repositoryService;

    public RepositoryController(RepositoryService repositoryService) {
        this.repositoryService = repositoryService;
    }

    @GetMapping("/repositories/{name}/status")
    public CommitStatus getRepositoryStatus(@PathVariable String name) {
        return repositoryService.getRepositoryStatus(name);
    }
}




